[정민서-9주차 알고리즘 스터디]#11
Open
minseojeong1012 wants to merge 50 commits intoSSAFY13th-algorithm:minseojeong/week9from
Open
[정민서-9주차 알고리즘 스터디]#11minseojeong1012 wants to merge 50 commits intoSSAFY13th-algorithm:minseojeong/week9from
minseojeong1012 wants to merge 50 commits intoSSAFY13th-algorithm:minseojeong/week9from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 싸피 15반 알고리즘 스터디 9주차 [정민서]
📌 문제 풀이 개요
✅ 문제 해결 여부
💡 풀이 방법
문제 1: 유기농 배추
문제 난이도
실버 2
문제 유형
그래프
접근 방식 및 풀이
dx, dy를 사용해 상하좌우 값을 조회하였고, dfs를 사용하고 배추가 아직 있고 방문하지 않은 경우에만 재귀를 해서 count 값을 갱신하였다.
문제 2: DFS와 BFS
문제 유형
그래
문제 난이도
실버 2
접근 방식 및 풀이
주어지는 간선이 서로 연결되어 있기 때문에 어레이 리스트를 사용하여 값들을 관리해서 문제를 풀었습니다
문제 3: 숨바꼭질
문제 유형
그래프
문제 난이도
실버 1
접근 방식 및 풀이
bfs를 사용해서 거리를 기록했습니다. 문제에서 제시한 대로 -1, +1, *2 이 세가지 가능한 이동이 있었기 때문에 int 배열로 관리해서 문제를 해결했습니다.
문제 4: 적록색약
문제 유형
그래프
문제 난이도
골드 5
접근 방식 및 풀이
원본 격자를 복사해서 gridForColorblin 배열을 만든 후, G를 R 로 변경했습니다
이 격자를 사용해서 DFS로 영역을 계산 후 일반인의 영역 수와 적록색약의 영역 수를 공백으로 구분하여 출력하였습니다.
문제 5: 플로이드
문제 유형
그래프
문제 난이도
골드 4
접근 방식 및 풀이
배열의 모든 값을 가장 큰값으로 초기화 하고, 자기 자신으로 가는 거리는 0으로 초기화
중간 정점인 k를 1부터 n 까지 순회하면서
dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]) 로 업데이트
그 후 i 에서 j로 갈 수 없는 경우는 0을 출력 -> 무한대로 남아있기 때문에
나머지는 계산된 최단거리를 출력